Repository navigation
fix(echarts): retain the clicked category when drilling on mixed charts - #46379
Conversation
| if ( | ||
| categoryValue === null || | ||
| typeof categoryValue === 'string' || | ||
| typeof categoryValue === 'number' | ||
| ) { |
There was a problem hiding this comment.
Suggestion: Boolean values are valid categorical x-axis values, but this guard rejects them, so drilling from a Boolean category omits its filter.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Type error
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/EchartsMixedTimeseries.tsx
**Line:** 277:281
**Comment:**
*Type Error: Boolean values are valid categorical x-axis values, but this guard rejects them, so drilling from a Boolean category omits its filter.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fixThere was a problem hiding this comment.
Confirmed at 578053e: a Boolean x-axis is a category axis (getAxisType), and data[0] or the matched point stays true/false, so this guard drops it and Drill by runs without the clicked category. Plain Timeseries keeps it through the name fallback.
| if ( | |
| categoryValue === null || | |
| typeof categoryValue === 'string' || | |
| typeof categoryValue === 'number' | |
| ) { | |
| if ( | |
| categoryValue === null || | |
| typeof categoryValue === 'string' || | |
| typeof categoryValue === 'number' || | |
| typeof categoryValue === 'boolean' | |
| ) { |
There was a problem hiding this comment.
✅ CodeAnt verified this suggestion was addressed in subsequent commits and marked this thread resolved as of 7e64640.
The category-value guard now accepts booleans, so Boolean x-axis values are added to xAxisFilters.
If that's not right, unresolve this thread and CodeAnt will leave it open.
There was a problem hiding this comment.
Added boolean to the guard in 7e64640. Four red-first cases cover true and false on point and markerless clicks; all six focused suites pass.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #46379 +/- ##
=======================================
Coverage 85.66% 85.67%
=======================================
Files 3111 3111
Lines 214938 214948 +10
Branches 50908 50920 +12
=======================================
+ Hits 184136 184147 +11
+ Misses 27381 27380 -1
Partials 3421 3421
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gabotorresruiz
left a comment
There was a problem hiding this comment.
Hi @mikebridge, thanks for this fix, LGTM. I ran the new tests on the merge base and on this head, and clicked through sparse, numeric, <NULL> and separator-heavy categories: the category filter lands only on the clicked query, and temporal axes send the same payload as before.
+1 to @aminghadersohi's boolean suggestion, with it both point and markerless clicks keep true/false.
One ask before this merges: the description still reads as a draft with the browser run failing. Could you update it with where that landed, in particular the case that could not open the submenu?
CI is green.
| if (filter?.grain) { | ||
| xAxisFilters.push(filter); | ||
| } | ||
| } else if (xAxis.type === AxisType.Category && xAxisColumn) { |
There was a problem hiding this comment.
Not a blocker. Plain Timeseries still resolves a category click with getXAxisValue(data, eventParams.name), so a markerless line or area click there sends no category filter, the same gap this fixes for Mixed. Is a follow-up planned for it?
There was a problem hiding this comment.
That plain Timeseries path is unchanged here. I'd like to take its markerless-category handling as a separate follow-up so this patch stays focused on Mixed.
|
@gabotorresruiz I've updated the description. The later browser runs passed for both source types, three repetitions each, in two consecutive runs with no retries. They isolate query B and wait for the menu before checking its pivoted results, which covers the earlier case that could not open the submenu. Series isolation and the animation waits changed together, so I can't say which one fixed it. Those runs do not cover the Boolean change in 7e64640 or general keyboard interaction. |
…ts (#46379) Co-authored-by: Mike Bridge <michael.bridge@ext.preset.io>
SUMMARY
Drill by on a Mixed Timeseries chart keeps the clicked category for the selected query, for datasets and semantic views.
Mixed charts passed series filters and temporal buckets to Drill by but omitted non-temporal categories. This adds the category to the existing scope and resolves markerless line/area clicks through the rendered category axis. The category must exist in the clicked series, preserving sparse-query behavior. Boolean categories retain their true/false values too. Temporal handling, cross-filter behavior and the other query's controls are unchanged.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: drilling from CORP on a markerless line could return other categories and omit CORP from the breadcrumb. After: the selected query receives the CORP predicate. Browser checks on revision
3fa9b120b8d804cc4b69c16a972238e6b2dc1a97verified the breadcrumb, chart mode and selected query's table with only CORP and independently calculated F=30.25/O=7.75. No layout change.TESTING INSTRUCTIONS
ADDITIONAL INFORMATION